<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<link href="${ctxStatic}/ajax/libs/summernote/summernote.css" rel="stylesheet"/>
<link href="${ctxStatic}/ajax/libs/summernote/summernote-bs3.css" rel="stylesheet"/>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-notice-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">公告标题：</label>
				<div class="col-sm-8">
					<input id="noticeTitle" name="noticeTitle" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">公告类型：</label>
				<div class="col-sm-8">
					<select name="noticeType" class="form-control m-b"  >
						<c:forEach items="${fnc:getDictDataByTypeList('sys_notice_type')}" var="dict">
							<option  value="${dict.dictValue}" >${dict.dictLabel}</option>
						</c:forEach>
					</select>


				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">公告内容：</label>
				<div class="col-sm-8">
				    <input id="noticeContent" name="noticeContent" type="hidden">
				    <div class="summernote"></div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">公告状态：</label>
				<div class="col-sm-8">

					<c:forEach items="${fnc:getDictDataByTypeList('sys_notice_status')}" var="dict">
						<div class="radio-box">
							<input type="radio" id="${dict.dictCode}" name="status" value="${dict.dictValue}" checked="${dict.isDefault == 'Y' ? true : false}"/>
							<label for="${dict.dictCode}">${dict.dictLabel}</label>
						</div>
					</c:forEach>
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
	<%@ include file="/WEB-INF/views/include/header.jsp"%>
    <script  src="${ctxStatic}/ajax/libs/summernote/summernote.min.js"></script>
    <script src="${ctxStatic}/ajax/libs/summernote/summernote-zh-CN.js"></script>
    <script type="text/javascript">
        var prefix = ctx + "sys/notice";
    
	    $('.summernote').summernote({
			height : '220px',
			lang : 'zh-CN'
		});
		
		$("#form-notice-add").validate({
			rules:{
				noticeTitle:{
					required:true,
				}
			},
			submitHandler: function(form) {
				var sHTML = $('.summernote').code();
				$("#noticeContent").val(sHTML);
				$.operate.save(prefix + "/add", $('#form-notice-add').serialize());
			}
		});
	</script>
</body>
</html>
